<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>网格布局</title>
	<style>
		.container {
			display: grid;
			border: 1px solid #b29400;
			height: 1000px;
			width: 1000px;
			/*列单元大小*/
			grid-template-columns: 100px 100px 100px;
			/*行项目大小*/
			grid-template-rows: 100px 100px 100px;
			/*行间距*/
			grid-row-gap: 20px;
			/*列间距*/
			grid-column-gap: 20px;
			/*行列顺序*/
			grid-auto-flow: column;
			/*在容器内的水平方向显示位置*/
			justify-content: center;
			/*在容器内垂直方向显示位置*/
			align-content: center;
		}

		.item {
			border: 1px solid palevioletred;
			width: 100px;
			height: 100px;
			display: grid;
			justify-content: center;
			align-content: center;
		}
	</style>
</head>
<body>
<div class="container">
	<div class="item">
		<div class="item-box">11</div>
		<div class="item-box">21</div>
		<div class="item-box">31</div>
	</div>
	<div class="item">2</div>
	<div class="item">3</div>
	<div class="item">4</div>
	<div class="item">5</div>
	<div class="item">6</div>
	<div class="item">7</div>
	<div class="item">8</div>
	<div class="item">9</div>
</div>
</body>
</html>
